/*
 * @Description: 对应UserList.vue接口API
 * @Author: Liu Kunpeng
 * @Date: 2021-07-14 10:35:20
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-12-23 17:15:34
 */

import request from "@/utils/request"
//获取所有机构
export function getAllCustomerApi(queryInfo){
    return request({
        url: '/admin/organization/getAll',
        method: 'get',
        params: queryInfo
    })
}
// //添加机构
// export function addCustomerApi(data){
//     return request({
//         url: '/admin/organization/insert',
//         method: 'post',
//         data
//     })
// }
//添加机构
export function addCustomerApi(data){
    return request({
        url: '/admin/organization/newInsert',
        method: 'post',
        config : {
            headers: {
            'Content-Type': 'multipart/form-data',
            'constnet-type': 'multipart/form-data',
            }
},
        data

    })
}
//添加设备
export function addDeviceApi(data){
    return request({
        url: '/admin/organization/device/insert',
        method: 'post',
        data
    })
}
//添加科室
export function addDepartmentApi(data){
    return request({
        url: '/admin/organization/department/insert',
        method: 'post',
        data
    })
}
//获取本机构的所有科室和设备
export function getDetailsByIdApi(id){
    return request({
        url: '/admin/organization/getDepAndDevById',
        method: 'get',
        params: {id}  //?id=1
    })
}

export function editOrgApi(data){
    return request({
        url: '/admin/organization/updateOrg',
        method: 'put',
        data
    })
}

export function deleteOrgApi(id){
    return request({
        url: '/admin/organization/remove/' + id,
        method: 'delete',
    })
}

export function deleteDepApi(id){
    return request({
        url: '/admin/organization/department/remove/' + id,
        method: 'delete',
    })
}
//修改医院图标
export function editOrgPictureApi(data){
    return request({
        url: '/admin/organization/updateOrgPicture',
        method: 'put',
        data
    })
}
//强制修改设备密码
export function forceModifyPassword(data){
    return request({
        url: '/admin/acl/index/forceUpdatePassword',
        method: 'get',
        params: data
    })
}